<?php

namespace App\Models;

use App\Http\Consts\LangConsts;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    protected $table = 'article';

    public $timestamps = false;

    protected $fillable = [
        'title',
        'synopsis',
        'author',
        'content',
        'article_type_id',
        'show_img_id',
        'status',
        'owner_id',
        'is_hot',
        'is_top',
        'created_at',
        'updated_at',
    ];

    protected function getArticleTypeStrAttribute($id
    )
    {
        $map = new Map();
        return $map->where('id',$id)->first()['name'];
    }

}
